<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Using Constraint Handling Rules
</TITLE>
</HEAD>
<BODY >
<A HREF="libman043.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman042.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman045.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc81">8.2</A>&nbsp;&nbsp;Using Constraint Handling Rules</H2>
Here are the steps to be taken from writing to using <FONT COLOR=purple>CHR</FONT>s:
<UL CLASS="itemize"><LI CLASS="li-itemize">
 Write a <FONT COLOR=purple>CHR</FONT> program in a file 
File<CODE>.chr</CODE>.<BR>
<BR>
<LI CLASS="li-itemize">In ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>, load the <TT>chr</TT> library with the query
<CODE>lib(chr)</CODE>. It contains both the compiler and runtime system for
<FONT COLOR=purple>CHR</FONT>s. Now ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> is in coroutining mode.<BR>
<BR>
<LI CLASS="li-itemize">Compile your <CODE>chr</CODE> file into a <CODE>pl</CODE> file with the query
 <CODE>chr2pl(</CODE>File<CODE>).</CODE><BR>
<BR>
<LI CLASS="li-itemize">In any ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> session, you can load a compiled constraint handler
(<CODE>[</CODE>File<CODE>].</CODE>). The <FONT COLOR=purple>CHR</FONT> library is automatically loaded
to provide the necessary runtime environment. ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> is in coroutining mode.</UL>

You can compile your <CODE>chr</CODE> file and load the resulting <CODE>pl</CODE> file
at once using the query <CODE>chr(</CODE>File<CODE>).</CODE><BR>
<BR>
<HR>
<A HREF="libman043.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman042.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman045.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
